package com.azt.novel.book.controller;



import com.azt.novel.book.dto.resp.BookCategoryRespDto;
import com.azt.novel.book.service.IBookCategoryService;
import com.azt.novel.common.resp.RestResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 小说类别 前端控制器
 * </p>
 *
 * @author azt
 * @since 2023-12-02
 */
@RestController
@RequestMapping("/api/front/book")
public class BookCategoryController {
    @Resource
    private IBookCategoryService iBookCategoryService;

    /**
     * 小说分类列表查询
     * @param workDirection
     * @return
     */
    @Operation(summary = "小说分类列表查询接口")
    @GetMapping("/category/list")
    public RestResp<List<BookCategoryRespDto>> listCategorys(
            @Parameter(description = "作品方向", required = true) Integer workDirection){
        return iBookCategoryService.listCategorys(workDirection);
    }

}
